package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * 考勤申诉
 * @author 潘寻毅
 *
 */

@Entity
@Table(name="attend_complaint")
public class AttendComplaint {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ac_id")
	private Long id;//申诉id
	
	@Column(name="ac_content",nullable=false)
	private String content;//申诉理由
	
	@JsonIgnore
	@OneToOne(cascade=CascadeType.ALL,fetch = FetchType.LAZY)
	@JoinColumn(name = "wa_id")
	private WorkAttend workattend;//考勤记录id
	
	@Column(name="ac_result")
	private String result;//处理说明
	
	@Column(name="ac_state")
	private int state=0;//申诉状态
	
	@Column(name="ac_reason")
	private String reason;//申请内容
	
	@Column(name="ac_time")
	private Date time=new Date();//申诉时间
	
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.ALL,fetch = FetchType.LAZY)
	@JoinColumn(name = "u_id")
	private User user;//考勤记录id
	
	public AttendComplaint() {}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public WorkAttend getWorkattend() {
		return workattend;
	}

	public void setWorkattend(WorkAttend workattend) {
		this.workattend = workattend;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}
	
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "AttendComplaint [id=" + id + ", content=" + content +  ", result="
				+ result + ", state=" + state + ", reason=" + reason + "]";
	}

	
	
	
}





